package Example18_19;
class Animal{
   void shout(){
       System.out.println("动物叫");
   }
   public String toString(){
       return "我是一个动物类";
    }
}

public class Example18 {
    public static void main(String[] args) {
        Animal animal = new Animal();
        System.out.println(animal.toString());
    }
}